<?php
  
  class PengumumanMain{
    var $procDir='com/pengumuman/process/';
    var $procObj;
    //var $params=array();
    
    public function PengumumanMain($act,$params){
      $this->loadProcess('ProcessPengumuman.class.php');
      $this->procObj=new ProcessPengumuman();
      $this->params=$params;
      $this->addAction($act);
    }
    
    function loadProcess($processFile){
      if(file_exists($this->procDir.$processFile)){
         require($this->procDir.$processFile); 
      }else{
        print('Process File '.$this->procDir.$processFile.' Not Exist');
      }   
    }
    
    function addAction($act=""){
      switch($act){
        case "getPengumuman":
           $this->procObj->getPengumuman($this->params[0]);
        break;
        case "getPengumumanByMhsId":
           $this->procObj->getPengumumanByMhsId($this->params[0]);
        break;
        case "getPengumumanById":
           $this->procObj->getPengumumanById($this->params[0]);
        break;
        case "doAddPengumuman":
           $this->procObj->doAddPengumuman($this->params[0],$this->params[1],$this->params[2]);
        break;
        case "doUpdatePengumuman":
           $this->procObj->doUpdatePengumuman($this->params[0],$this->params[1],$this->params[2],$this->params[3]);
        break;
        default:
          die('Function '.$act.' Not Declare');
        break;
      }
    }
  }
?>
